// jml biji seleksi =  jml biji diterima - jml biji discard
var jml_biji_total_update = function(){
	var jml_biji_belum_tumbuh   = parseInt($('input#jml_biji_belum_tumbuh').val());
	var jml_biji_gagal			= parseInt($('input#jml_biji_gagal').val());
	var jml_biji_seleksi 		= parseInt($('input#jml_biji_seleksi').val());
	
	var jml_biji_total = jml_biji_seleksi - (jml_biji_belum_tumbuh + jml_biji_gagal);
	
	if( isNaN(jml_biji_total) || jml_biji_total < 0 )
		jml_biji_total = 0;
		
	$('input#jml_biji_total').val(jml_biji_total);
}

$('input#jml_biji_gagal').change(function(){
	jml_biji_total_update();
});

$('input#jml_biji_belum_tumbuh').change(function(){
	jml_biji_total_update();
});

